var __extends =
    (this && this.__extends) ||
    (function () {
      var n = function (e, t) {
        return (n =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (n, e) {
              n.__proto__ = e;
            }) ||
          function (n, e) {
            for (var t in e)
              Object.prototype.hasOwnProperty.call(e, t) && (n[t] = e[t]);
          })(e, t);
      };
      return function (e, t) {
        function o() {
          this.constructor = e;
        }
        if ("function" != typeof t && null !== t)
          throw new TypeError(
            "Class extends value " + String(t) + " is not a constructor or null"
          );
        n(e, t),
          (e.prototype =
            null === t
              ? Object.create(t)
              : ((o.prototype = t.prototype), new o()));
      };
    })(),
  NPCFuBenView = (function (n) {
    function e() {
      var e = n.call(this) || this;
      return (
        e.btn_fuben_npc_yaopin.on(
          Laya.Event.CLICK,
          e,
          e.onFuBenNPCYaoPinAction
        ),
        e.btn_fuben_npc_back.on(Laya.Event.CLICK, e, e.onFuBenNPCBackAction),
        WebSocketService.addListener({
          caller: e,
          code: 18161,
          method: e.onLoadFuBenTaskData,
        }),
        WebSocketService.addListener({
          caller: e,
          code: 1816,
          method: e.onLoadFuBenZhanGongData,
        }),
        (e.list_fuben_task_main.vScrollBarSkin = ""),
        (e.list_fuben_task_branch.vScrollBarSkin = ""),
        e
      );
    }
    return (
      __extends(e, n),
      (e.showFuBenNPCView = function () {
        return (
          null == this.fuBenNPC && (this.fuBenNPC = new e()),
          WebSocketService.send({ c: 18161 }),
          WebSocketService.send({ c: 1816 }),
          this.fuBenNPC
        );
      }),
      (e.prototype.onLoadFuBenTaskData = function (n) {
        if (0 == n.code) {
          for (
            var e = void 0,
              t = void 0,
              o = n.data.mainTask,
              a = n.data.branchTask,
              i = [],
              r = [],
              c = 0;
            c < o.length;
            c++
          ) {
            (e = { item_name: { text: (s = o[c]).mission } }), i.push(e);
          }
          this.list_fuben_task_main.dataSource = i;
          for (var u = 0; u < a.length; u++) {
            var s = a[u];
            (t = { item_name: { text: s.mission } }), r.push(t);
          }
          this.list_fuben_task_branch.dataSource = r;
        }
      }),
      (e.prototype.onLoadFuBenZhanGongData = function (n) {
        if (0 == n.code) {
          var e = n.data[0];
          this.labe_fuben_zhangong.text = e.userName + " : " + e.score;
        }
      }),
      (e.prototype.onFuBenNPCYaoPinAction = function () {
        var n = MedicalView.showFuBenMedicalView();
        (n.y = 70), Laya.stage.addChild(n);
      }),
      (e.prototype.onFuBenNPCBackAction = function () {
        this.removeSelf();
      }),
      e
    );
  })(ui.NPCDialog.NPCFuBenMainViewUI);
